package cn.wolfcode.wolf2w.business.controller.admin;

import cn.wolfcode.wolf2w.business.service.INoteEsService;
import cn.wolfcode.wolf2w.business.service.IStrategyEsService;

import cn.wolfcode.wolf2w.business.service.ITaDestinationEsService;
import cn.wolfcode.wolf2w.business.service.IUserInfoEsService;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SearchAdminController {

    @Autowired
    private IStrategyEsService strategyEsService;

    @Autowired
    private INoteEsService noteEsService;

    @Autowired
    private IUserInfoEsService userInfoEsService;

    @Autowired
    private ITaDestinationEsService taDestinationEsService;

//    @GetMapping("/dataInit")
//    public R<?> dataInit(){
//        strategyEsService.initStrategyEs();
//        noteEsService.initNoteEs();
//        userInfoEsService.initUserInfoEs();
//        taDestinationEsService.initTaDestinationEs();
//        return R.ok("初始化成功");
//    }

    @GetMapping("/dataStrategyInit")
    public R<?> dataStrategyInit(){
        strategyEsService.initStrategyEs();
        return R.ok("Strategy初始化成功");
    }

    @GetMapping("/dataNoteInit")
    public R<?> dataNoteInit(){
        noteEsService.initNoteEs();
        return R.ok("Note初始化成功");
    }

    @GetMapping("/dataUserInfoInit")
    public R<?> dataUserInfoInit(){
        userInfoEsService.initUserInfoEs();
        return R.ok("UserInfo初始化成功");
    }

    @GetMapping("/dataTaDestinationInit")
    public R<?> dataTaDestinationInit(){
        taDestinationEsService.initTaDestinationEs();
        return R.ok("TaDestination初始化成功");
    }
}
